package Collection.weekwork;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;

public class getsetwork {
    public static void main(String[] args) {
        List<String> list =new ArrayList<>();
        list.add("one");
        list.add("two");
        list.add("three");
        list.add("four");
        list.add("five");
        list.add("six");
        System.out.println("获取第一个元素"+list.get(0));
        String s=list.set(2,"3");
        System.out.println("s:+"+s+"获取第三个元素"+list.get(2));

        list.remove(1);
        System.out.println(list);

        list.remove("one");
        System.out.println(list);

        list.add(1,"three");
        System.out.println(list);

        List<String> str =list.subList(1,4);
        System.out.println(str);

        int[] i={1,2,2,4,34};
        int[] b=new int[6];
        System.arraycopy(i,1,b,2,3);
        System.out.println(Arrays.toString(b));
    }
}






